using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WebFoundation;

namespace MHI.InspectionManager.Interfaces
{
	/// <summary>
	/// DevPlandeviceT,table entity:dev_plandevice_t 
	/// </summary>
	public class DevPlandeviceT
	{
		public static readonly string KeyId;
		public static readonly string KeyPlanJobId;
		public static readonly string KeyDeviceId;
		public static readonly string KeyDeviceOrder;
		public static readonly string KeyPlanRemark;
		public static readonly string KeyGmtCreated;
		public static readonly string KeyPersonModified;
		public static readonly string KeyGmtModified;
		public static readonly string KeyStateInfo;
		public static readonly string KeyIsUse;
		public static readonly string KeyVersion;
		

		static DevPlandeviceT()
		{
			KeyId = ExpressionHelper.GetPropertyName<DevPlandeviceT>(r => r.Id);
			KeyPlanJobId = ExpressionHelper.GetPropertyName<DevPlandeviceT>(r => r.PlanJobId);
			KeyDeviceId = ExpressionHelper.GetPropertyName<DevPlandeviceT>(r => r.DeviceId);
			KeyDeviceOrder = ExpressionHelper.GetPropertyName<DevPlandeviceT>(r => r.DeviceOrder);
			KeyPlanRemark = ExpressionHelper.GetPropertyName<DevPlandeviceT>(r => r.PlanRemark);
			KeyGmtCreated = ExpressionHelper.GetPropertyName<DevPlandeviceT>(r => r.GmtCreated);
			KeyPersonModified = ExpressionHelper.GetPropertyName<DevPlandeviceT>(r => r.PersonModified);
			KeyGmtModified = ExpressionHelper.GetPropertyName<DevPlandeviceT>(r => r.GmtModified);
			KeyStateInfo = ExpressionHelper.GetPropertyName<DevPlandeviceT>(r => r.StateInfo);
			KeyIsUse = ExpressionHelper.GetPropertyName<DevPlandeviceT>(r => r.IsUse);
			KeyVersion = ExpressionHelper.GetPropertyName<DevPlandeviceT>(r => r.Version);
		}
		

		private long _id; 
		private long? _planJobId; 
		private long? _deviceId; 
		private byte _deviceOrder; 
		private string _planRemark; 
		private DateTime? _gmtCreated; 
		private string _personModified; 
		private DateTime? _gmtModified; 
		private float? _stateInfo; 
		private int _isUse; 
		private long _version; 
		

		/// <summary>
		///  Id, column: id required
		/// </summary>
		[DisplayName("编码")]
		[Required]
		public long Id
		{
			get{ return _id; }
			set
			{
				if(_id != value)
				{
					_id = value;
					NotifyOfChange(KeyId);
				}
			}
		}

		/// <summary>
		///  PlanJobId, column: plan_job_id 
		/// </summary>
		[DisplayName("计划ID或工单ID")]
		public long? PlanJobId
		{
			get{ return _planJobId; }
			set
			{
				if(_planJobId != value)
				{
					_planJobId = value;
					NotifyOfChange(KeyPlanJobId);
				}
			}
		}

		/// <summary>
		///  DeviceId, column: device_id 
		/// </summary>
		[DisplayName("设备ID")]
		public long? DeviceId
		{
			get{ return _deviceId; }
			set
			{
				if(_deviceId != value)
				{
					_deviceId = value;
					NotifyOfChange(KeyDeviceId);
				}
			}
		}

		/// <summary>
		///  DeviceOrder, column: device_order 
		/// </summary>
		[DisplayName("设备序号")]
		[Required]
		public byte DeviceOrder
		{
			get{ return _deviceOrder; }
			set
			{
				if(_deviceOrder != value)
				{
					_deviceOrder = value;
					NotifyOfChange(KeyDeviceOrder);
				}
			}
		}

		/// <summary>
		///  PlanRemark, column: plan_remark 
		/// </summary>
		[DisplayName("设备保养维修备注")]
		public string PlanRemark
		{
			get{ return _planRemark; }
			set
			{
				if(_planRemark != value)
				{
					_planRemark = value;
					NotifyOfChange(KeyPlanRemark);
				}
			}
		}

		/// <summary>
		///  GmtCreated, column: gmt_created 
		/// </summary>
		[DisplayName("@desc创建时间")]
		public DateTime? GmtCreated
		{
			get{ return _gmtCreated; }
			set
			{
				if(_gmtCreated != value)
				{
					_gmtCreated = value;
					NotifyOfChange(KeyGmtCreated);
				}
			}
		}

		/// <summary>
		///  PersonModified, column: person_modified 
		/// </summary>
		[DisplayName("@desc更新人")]
		public string PersonModified
		{
			get{ return _personModified; }
			set
			{
				if(_personModified != value)
				{
					_personModified = value;
					NotifyOfChange(KeyPersonModified);
				}
			}
		}

		/// <summary>
		///  GmtModified, column: gmt_modified 
		/// </summary>
		[DisplayName("@desc更新时间")]
		public DateTime? GmtModified
		{
			get{ return _gmtModified; }
			set
			{
				if(_gmtModified != value)
				{
					_gmtModified = value;
					NotifyOfChange(KeyGmtModified);
				}
			}
		}

		/// <summary>
		///  StateInfo, column: state_info 
		/// </summary>
		[DisplayName("标识状态")]
		public float? StateInfo
		{
			get{ return _stateInfo; }
			set
			{
				if(_stateInfo != value)
				{
					_stateInfo = value;
					NotifyOfChange(KeyStateInfo);
				}
			}
		}

		/// <summary>
		///  IsUse, column: is_use 
		/// </summary>
		[DisplayName("是否可用")]
		[Required]
		public int IsUse
		{
			get{ return _isUse; }
			set
			{
				if(_isUse != value)
				{
					_isUse = value;
					NotifyOfChange(KeyIsUse);
				}
			}
		}

		/// <summary>
		///  Version, column: version 
		/// </summary>
		[DisplayName("版本")]
		[Required]
		public long Version
		{
			get{ return _version; }
			set
			{
				if(_version != value)
				{
					_version = value;
					NotifyOfChange(KeyVersion);
				}
			}
		}

		public event PropertyChangedEventHandler PropertyChanged;

		private void NotifyOfChange(string propertyName)
		{
			if (this.PropertyChanged != null)
			{
				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
			}
		}
	}
}
